For details about the/dev/null and/dev/zero files, and solutions for accidental deletion of/dev/null and/dev/zero, and the disk I/O Testing Method Using/dev/zero, disk deletion and recovery by mistake1. Introduction-explanation from
1, Introduction--From the wiki interpretation/dev/null:In a Unix-like system, a/dev/null, or empty device, is a special device file that discards everything written to it (but reports a successful write operation) and reads it immediately to get an
What is the difference between echo and/dev/null in command for clearing file content?
We know that there are many methods to clear the file content. This article only talks about the differences between echo "And/dev/null.
1. What is the black
Linux is a file-based system, and all hardware, such as software, will have a corresponding file representation under the directory. For Dev This directory, we know the file below it, which represents the Linux device. In Windows systems, devices
Linux is a file system, and all hardware, such as software, will be represented under the appropriate directory. For the dev directory, we know that the file below it represents the Linux device. In Windows, devices are well understood, like hard
Using/dev/null
Think of/dev/null as a "black hole". It is very equivalent to a write-only file. All content written to it is lost forever. And trying to read content from it is nothing. However,/dev/null is very useful for both the command line and
This article goes from http://www.kissyu.org/backgroundWe can often find such statements in a shell script >/dev/null 2>&1 . Before I did not go into the role of this command, copy replicable, until last week I wrote this order accidentally 2>&1
The difference between/dev/null and/dev/zero/dev/null, nicknamed the Bottomless pit, you can output any data to it, it take all, and will not hold!/dev/zero, is an input device that you can use to initialize files. The device provides an exhaustive 0
Use
/Dev/null
Set/Dev/nullIt is regarded as a "black hole". It is very equivalent to a write-only file. All the content written to it will be lost forever. However, if you try to read the content from it, nothing can be read.
The shell can often be seen: >/dev/null 2>&1The result of the command can be defined in the form of a%> output/dev/null represents an empty device fileWhere does the > delegate redirect to, for example: echo "123" >/home/123.txt1 means stdout
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.